package com.hncg.entity;
//序列化接口：将对象中的属性和属性值存储到本地，如游戏存档。
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
//lombok自动生成get各属性set的方法
@Data
//生成全参数构造器
@AllArgsConstructor
//也要生成无参构造器
@NoArgsConstructor
public class User implements Serializable {
    //四个属性名对应数据库中表的四个字段名
    private int id;
    private String name;
    private String pwd;
    private int age;
    private String hiredate;

    public User(String name, String pwd, int age) {
        this.name= name;
        this.pwd= pwd;
        this.age = age;
    }

    public User(String name, String pwd, int age, String hiredate) {
        this.name= name;
        this.pwd= pwd;
        this.age = age;
        this.hiredate = hiredate;
    }

    public User(int id, String name, String pwd, int age) {
        this.id = id;
        this.name = name;
        this.pwd = pwd;
        this.age = age;
    }
}
